﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Data.SqlClient;



namespace sqxt
{
    public partial class report4 : Form
    {
        public report4()
        {
            InitializeComponent();
        }

        private void report4_Load(object sender, EventArgs e)
        {
            SqlDataAdapter sda = new SqlDataAdapter("select MedSite_Id  居委编码,MedSite_name 居委名册称,area 面积,families  家庭数,permanent_population 常住人口数,transient_population 流动人口数,man_population 男性人口数, woman_population  女性人口数,eld_population  老年人数,natural_growth_rate  人口自然增长率, create_files 居民建档数  from MedSite", Dbconnect.s1);
            DataTable dt = new DataTable();
            sda.Fill(dt);

            dataGridViewX1.DataSource = dt;
        }

        private void toolStripButton1_Click(object sender, EventArgs e)
        {
            string savePath = "";
            saveFileDialog1.Filter = "EXCEL(*.xls)|*.xls";
            if (saveFileDialog1.ShowDialog() == DialogResult.OK)
            {
                savePath = saveFileDialog1.FileName;
                expExcel.ExportData(dataGridViewX1, savePath);
            }
        }

        private void toolStripButton2_Click(object sender, EventArgs e)
        {
            this.Close();
        }
    }
}